import { request } from '@/framework/utils/request-jdz';

// 获取样本模板
export const getSampleTemplate = (params) => {
  return request(
    {
      url: 'specimenFormwork',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 获取样本类型
export const getSampleType = () => {
  return request(
    {
      url: 'specimenType/no-paging?orderBy[0].field=createTime&orderBy[0].order=desc&status=1',
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 添加样本模板
export const addSampleTemplate = (params: { name: string; commonCfgEntityList: any[] }) => {
  return request(
    {
      url: 'specimenFormwork',
      method: 'post',
      data: params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};

// 更新样本模板
export const updateSampleTemplate = (id, params: { name: string; commonCfgEntityList: any[] }) => {
  return request(
    {
      url: `specimenFormwork/${id}`,
      method: 'put',
      data: params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};

// 删除样本模板
export const delSampleType = (id) => {
  return request(
    {
      url: `specimenFormwork/${id}`,
      method: 'delete',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
